import request from '@/utils/request';
/**
 * 部门列表
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function fetchTreeList() {
    return request({
        url: '/scrm-api/console/work/contact/department/tree',
        method: 'get'
    });
}

/**
 * 部门搜索
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function searchTreeList(data: any) {
    return request({
        url: '/scrm-api/console/work/contact/department/search',
        method: 'get',
        params: data
    });
}

/**
 * 新增部门
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function addTreeList(data: any) {
    return request({
        url: '/scrm-api/console/work/contact/department/add',
        method: 'post',
        data: data
    });
}
/**
 * 删除部门
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function delTreeList(data: any) {
    return request({
        url: '/scrm-api/console/work/contact/department/del',
        method: 'post',
        data: data
    });
}
/**
 * 员工列表
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function workUserList(data: any) {
    return request({
        url: '/scrm-api/console/work/contact/work-user/list',
        method: 'get',
        params: data
    });
}
/**
 * 添加员工
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function addUserList(data: any) {
    return request({
        url: '/scrm-api/console/work/contact/work-user/add',
        method: 'post',
        data: data
    });
}
/**
 * 获取标签组列表
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function userTagList() {
    return request({
        url: '/scrm-api/console/work/contact/user-tag/group-list',
        method: 'get'
    });
}
/**
 * 获取标签列表
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function userTagsList(data: any) {
    return request({
        url: '/scrm-api/console/work/contact/user-tag/user-tag-list',
        method: 'get',
        params: data
    });
}
/**
 * 新增标签
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function userTagsAdd(data: any) {
    return request({
        url: '/scrm-api/console/work/contact/user-tag/user-tag-add',
        method: 'post',
        data: data
    });
}
/**
 * 删除员工
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function delWorkUser(data: any) {
    return request({
        url: '/scrm-api/console/work/contact/work-user/del',
        method: 'post',
        data: data
    });
}
/**
 * 通讯录同步
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function workContact() {
    return request({
        url: '/scrm-api/console/work/contact/sync',
        method: 'post'
    });
}
/**
 * 更新部门
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function updateDepartment(data: any) {
    return request({
        url: '/scrm-api/console/work/contact/department/update',
        method: 'post',
        data: data
    });
}
/**
 * 获取员工详情
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function workUserDetail(data: any) {
    return request({
        url: '/scrm-api/console/work/contact/work-user/detail',
        method: 'get',
        params: data
    });
}
/**
 * 添加员工
 * @param params
 * @returns {PromiseLike<T | never> | Promise<T | never> | *}
 */
export function putUserList(data: any) {
    return request({
        url: '/scrm-api/console/work/contact/work-user/put',
        method: 'post',
        data: data
    });
}
// 高级同步
export function superAsync(data: any) {
    return request({
        url: '/scrm-api/console/work/contact/sync',
        method: 'post',
        data: data
    });
}
// 高级同步查询
export function queryAsync(data: any) {
    return request({
        url: 'scrm-api/console/work/contact/sync-result',
        method: 'post',
        data: data
    });
}
// 客户保护
export function guestKeep(data: any) {
    return request({
        url: 'scrm-api/console/work/contact/work-user/protect',
        method: 'post',
        data: data
    });
}
// 客户保护预请求
export function beforeKeep(data: any) {
    return request({
        url: 'scrm-api/console/customer/protect-pre',
        method: 'post',
        data
    });
}
// 获取角色列表
export function roleList(data: any) {
    return request({
        url: 'scrm-api/console/login-api/role/list',
        data
    });
}
// 开启子账号
export function subAccount(data: any) {
    return request({
        url: 'scrm-api/console/work/contact/work-user/patch-enable-sub-account',
        method: 'POST',
        data
    });
}
// 子账号剩余数量
export function accountCount(data: any) {
    return request({
        url: 'scrm-api/console/work/contact/work-user/remaining-account-count',
        method: 'POST',
        data
    });
}

// 获取高级配置
export function getAdvanceSetting(data: any) {
    return request({
        url: 'scrm-api/console/work/contact/work-user/get-advance-setting',
        method: 'POST',
        data
    });
}

// 更新高级配置
export function putAdvanceSetting(data: any) {
    return request({
        url: 'scrm-api/console/work/contact/work-user/put-advance-setting',
        method: 'POST',
        data
    });
}
